package rasterprimate;

import java.awt.Color;

import repast.simphony.valueLayer.ValueLayer;
import repast.simphony.visualizationOGL2D.ValueLayerStyleOGL;

public class FoodValueLayerStyleOGL implements ValueLayerStyleOGL {

	protected ValueLayer layer;

	public void init(ValueLayer layer) {
		this.layer = layer;
	}

	public float getCellSize() {
		return 15.0f;
	}

	/**
	 * Return the color based on the value at given coordinates.
	 */
	public Color getColor(final double... coordinates) {
		final double food = layer.get(coordinates);
		final int strength = (int) Math.min(food, 255);
		return new Color(0, strength, 0); 	// 0x000000 - black,
											// 0x00FF00 - green
	}

}
